/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/Layout/index.vue'
import { RouteConfig } from 'vue-router'

const crmRouter: RouteConfig = {
  path: '/CRM',
  component: Layout,
  redirect: '/CRM',
  name: 'CRM',
  meta: {
    title: 'CRM',
    icon: 'table'
  },
  children: [
    // 客户看板
    {
      path: 'dtCenter/customerKanban',
      // component: () => import('@/views/dtCenter/customerKanban'),
      name: '客户看板',
      meta: {
        title: '客户看板'
      }
    },
    // 文件看板
    {
      path: 'dtCenter/fileMonitor',
      // component: () => import('@/views/dtCenter/fileMonitor'),
      name: '文件看板',
      meta: {
        title: '文件看板'
      }
    },
    // 1
    // 2
    // 3
    // 商机管理 opportunityManege
    {
      path: 'opportunityManege',
      // component: () => import('@/views/CRM/opportunityManege/opportunity/index'),
      name: 'opportunityManege',
      meta: { title: '商机管理列表' }
    },
    {
      path: 'opportunityDetail/:id',
      // component: () => import('@/views/CRM/opportunityManege/opportunity/detail'),
      name: 'opportunityDetail',
      meta: {
        title: '商机管理详情',
        hidden: true
      }
    },
    {
      path: 'totalClueInfo',
      // component: () => import('@/views/CRM/clue/totalClue/index'),
      name: 'totalClueInfo',
      meta: { title: '全部线索管理' }
    },
    {
      path: 'publicClueDetail/:id',
      // component: () => import('@/views/CRM/clue/totalClue/publicDetail'),
      name: 'publicClueDetail',
      meta: { title: '线索公池详情', hidden: true }
    },
    {
      path: 'dispatch',
      // component: () => import('@/views/CRM/clue/totalClue/dispatch'),
      name: 'dispatch',
      meta: { title: '分派线索', hidden: true }
    },
    {
      path: 'privateClue',
      // component: () => import('@/views/CRM/clue/privateClue/index'),
      name: 'privateClue',
      meta: { title: '线索私池管理' }
    },

    {
      path: 'privateClueDetail/:id/:by',
      // component: () => import('@/views/CRM/clue/privateClue/privateDetail'),
      name: 'privateClueDetail',
      meta: { title: '线索私池详情', hidden: true }
    },
    {
      path: 'transform',
      // component: () => import('@/views/CRM/clue/privateClue/transform'),
      name: 'transform',
      meta: { title: '线索转化', hidden: true }
    },

    // 拜访记录
    {
      path: 'visitRecord',
      // component: () => import('@/views/CRM/visitManagement/visitRecordManage/index'),
      name: 'visitRecord',
      meta: { title: '拜访记录' }
      // hidden: true
    },
    // 拜访计划
    {
      path: 'visitRecordDetail/:id/:by',
      // component: () => import('@/views/CRM/visitManagement/visitRecordManage/detail'),
      name: 'visitRecordDetail',
      meta: { title: '拜访记录详情' }
      // hidden: true
    },
    // 新增拜访记录
    // createVisitRecord
    {
      path: 'createVisitRecord/:id/:by/:deptId/:deptName/:linkman/:phone/:type/:associateName',
      // component: () => import('@/views/CRM/visitManagement/visitRecordManage/createVisitRecord'),
      name: 'createVisitRecord',
      meta: { title: '新增拜访记录' }
      // hidden: true
    },
    // 拜访计划
    {
      path: 'visitPlan',
      // component: () => import('@/views/CRM/visitManagement/visitPlanManage/index'),
      name: 'visitPlan',
      meta: { title: '拜访计划' }
      // hidden: true
    },
    // 新增拜访计划
    {
      path: 'visitPlanForm/:id/:by/:deptId/:deptName/:type/:linkman/:phone/:associateName',
      // component: () => import('@/views/CRM/visitManagement/components/visitPlanForm'),
      name: 'visitPlanForm',
      meta: { title: '新增拜访计划' }
      // hidden: true
    },
    // 拜访计划编辑或者推迟
    {
      path: 'visitPlanPut/:id/:type/:by',
      // component: () => import('@/views/CRM/visitManagement/components/visitPlanPut'),
      name: 'visitPlanPut',
      meta: { title: '编辑拜访计划' }
      // hidden: true
    },
    // 拜访计划详情
    {
      path: 'visitPlanDetail/:id/:by',
      // component: () => import('@/views/CRM/visitManagement/visitPlanManage/detail'),
      name: 'visitPlanDetail',
      meta: { title: '拜访计划详情' }
      // hidden: true
    },
    // 拜访计划明细里面的添加编辑拜访记录
    // createVisitRecord
    {
      path: 'createVisitPlanRecord/:id/:type/:by',
      // component: () => import('@/views/CRM/visitManagement/visitPlanManage/components/createVisitRecord'),
      name: 'createVisitPlanRecord',
      meta: { title: '拜访记录新增' }
      // hidden: true
    },
    // 签约管理
    // 签约管理
    {
      path: 'signManage',
      // component: () => import('@/views/CRM/signManage/index'),
      name: 'signManage',
      meta: { title: '签约管理' }
    },
    // 签约管理
    {
      path: 'signManageDetail/:signId/:chanceId',
      // component: () => import('@/views/CRM/signManage/detail'),
      name: 'signManageDetail',
      meta: { title: '签约客户详情' }
    },
    // 访问权限管理  visitWarrantyManage
    {
      path: 'visitWarrantyManage',
      // component: () => import('@/views/CRM/visitWarrantyManage/index'),
      name: 'visitWarrantyManage',
      meta: { title: '访问权限管理' }
    },
    {
      path: 'visitWarrantyManageDetail/:id/:deptId',
      // component: () => import('@/views/CRM/visitWarrantyManage/detail'),
      name: 'visitWarrantyManageDetail',
      meta: { title: '企业详情', hidden: true }
    },
    {
      path: 'market',
      // component: () => import('@/views/CRM/market/market'),
      name: 'market',
      meta: { title: '市场活动' }
    },
    {
      path: '_market',
      // component: () => import('@/views/CRM/market/_market'),
      name: '_market',
      meta: {
        title: '市场管理详情',
        hidden: true
      }
    },
    {
      path: '_cuepoolPr',
      // component: () => import('@/views/CRM/cuePoolPr/_cuepoolPr'),
      name: '_cuepoolPr',
      meta: {
        title: '线索明细',
        hidden: true
      }
    },
    {
      path: 'transformForm',
      // component: () => import('@/views/CRM/cuePoolPr/transformForm'),
      name: 'transformForm',
      meta: {
        title: '转换线索',
        hidden: true
      }
    },
    {
      path: 'cluePoolForm',
      // component: () => import('@/views/CRM/cuePoolPr/cluePoolForm'),
      name: 'cluePoolForm',
      meta: {
        title: '新增线索',
        hidden: true
      }
    },
    {
      path: 'cluepoolForm_Edit',
      // component: () => import('@/views/CRM/cuePoolPr/cluepoolForm_Edit'),
      name: 'cluepoolForm_Edit',
      meta: {
        title: '编辑线索',
        hidden: true
      }
    },
    {
      path: '_cuepoolPrInfo',
      // component: () => import('@/views/CRM/cuePoolPr/_cuepoolPrInfo'),
      name: '_cuepoolPrInfo',
      meta: {
        title: '拜访计划明细',
        hidden: true
      }
    },
    {
      path: 'publicImportErr',
      // component: () => import('@/views/CRM/publicPool/importErr'),
      name: 'publicImportErr',
      meta: {
        title: '线索公池导入失败',
        hidden: true
      }
    },
    {
      path: 'clueImportErr',
      // component: () => import('@/views/CRM/cuePoolPr/importErr'),
      name: 'clueImportErr',
      meta: {
        title: '线索私池导入失败',
        hidden: true
      }
    },
    {
      path: 'cusPublicImportErr',
      // component: () => import('@/views/CRM/customerPublicManage/importErr'),
      name: 'cusPublicImportErr',
      meta: {
        title: '客户公池导入失败',
        hidden: true
      }
    },
    {
      path: 'cusClueImportErr',
      // component: () => import('@/views/CRM/customerPrivateManage/importErr'),
      name: 'cusClueImportErr',
      meta: {
        title: '客户私池导入失败',
        hidden: true
      }
    },
    // 客户私池管理
    {
      path: 'customerPrivateManage',
      // component: () => import('@/views/CRM/customerPrivateManage/index'),
      name: 'customerPrivateManage',
      meta: { title: '客户私池管理' }
    },
    {
      path: 'customerPrivateManageAdd',
      // component: () => import('@/views/CRM/customerPrivateManage/insert'),
      name: 'customerPrivateManageAdd',
      meta: {
        title: '客户私池新增',
        hidden: true
      }
    },
    {
      path: 'customerPrivateManageDetail/:id/:deptId',
      // component: () => import('@/views/CRM/customerPrivateManage/detail'),
      name: 'customerPrivateManageDetail',
      meta: {
        title: '客户私池明细',
        hidden: true
      }
    },
    {
      path: 'customerPrivateManageEdit',
      // component: () => import('@/views/CRM/customerPrivateManage/edit'),
      name: 'customerPrivateManageEdit',
      meta: {
        title: '客户私池编辑',
        hidden: true
      }
    },
    {
      path: 'customerPrivateAddVisitRecord',
      // component: () => import('@/views/CRM/customerPublicManage/detailComponents/addVisitRecord'),
      name: 'customerPrivateAddVisitRecord',
      meta: {
        title: '新增拜访记录',
        hidden: true
      }
    },
    // 线索公池管理
    {
      path: 'publicPool',
      // component: () => import('@/views/CRM/publicPool/publicPool'),
      name: 'publicPool',
      meta: { title: '线索公池管理' }
    },
    {
      path: '_publicPool',
      // component: () => import('@/views/CRM/publicPool/_publicPool'),
      name: '_publicPool',
      meta: {
        title: '线索公池管理明细',
        hidden: true
      }
    },
    // 全部线索
    {
      path: 'publicPoolInfo',
      // component: () => import('@/views/CRM/publicPoolInfo/index'),
      name: 'publicPoolInfo',
      meta: { title: '全部线索管理' }
    },
    {
      path: 'publicPoolInfoDetail',
      // component: () => import('@/views/CRM/publicPoolInfo/detail'),
      name: 'publicPoolInfoDetail',
      meta: {
        title: '全部线索详情',
        hidden: true
      }
    },
    // 全部客户
    {
      path: 'customerManage',
      // component: () => import('@/views/CRM/customerManage/index'),
      name: 'customerManage',
      meta: { title: '全部客户管理' }
    },
    // deliverCustomer
    {
      path: 'deliverCustomer',
      // component: () => import('@/views/CRM/customerManage/deliver'),
      name: 'deliverCustomer',
      meta: { title: '分派/移交客户' }
    },
    {
      path: 'customerPublicManage',
      // component: () => import('@/views/CRM/customerPublicManage/index'),
      name: 'customerPublicManage',
      meta: { title: '客户公池管理' }
    },
    {
      path: 'customerPublicManageInsert',
      // component: () => import('@/views/CRM/customerPublicManage/insert'),
      name: 'customerPublicManageInsert',
      meta: {
        title: '客户公池新增',
        hidden: true
      }
    },
    {
      path: 'customerPublicManageDetail/:id',
      // component: () => import('@/views/CRM/customerPublicManage/detail'),
      name: 'customerPublicManageDetail',
      meta: {
        title: '客户公池详情',
        hidden: true
      }
    },
    {
      path: 'customerPublicManageEdit',
      // component: () => import('@/views/CRM/customerPublicManage/edit'),
      name: 'customerPublicManageEdit',
      meta: {
        title: '编辑客户公池',
        hidden: true
      }
    },
    // 拜访计划
    {
      path: 'visitManage',
      // component: () => import('@/views/CRM/visitManage/index'),
      name: 'visitManage',
      meta: { title: '拜访管理' }
    },
    // 线索公池管理
    {
      path: 'publicPool_add',
      // component: () => import('@/views/CRM/publicPool/publicPool_add'),
      name: 'publicPool_add',
      meta: {
        title: '新增线索公池',
        hidden: true
      }
    },
    {
      path: 'publicPool_edit',
      // component: () => import('@/views/CRM/publicPool/publicPool_edit'),
      name: 'publicPool_edit',
      meta: {
        title: '编辑线索公池',
        hidden: true
      }
    },
    // 客户管理
    // 供应商管理
    {
      path: 'supplier',
      // component: () => import('@/views/CRM/supplier/supplier'),
      name: 'supplier',
      meta: { title: '供应商管理' }
    },
    // 供应商管理新增
    {
      path: 'supplierInsert',
      // component: () => import('@/views/CRM/supplier/supplierInsert'),
      name: 'supplierInsert',
      meta: {
        title: '供应商管理新增',
        hidden: true
      }
    },
    // 供应商管理详情
    {
      path: 'supplierDetail/:id/:deptId',
      // component: () => import('@/views/CRM/supplier/supplierDetail/index'),
      name: 'supplierDetail',
      meta: {
        title: '供应商管理详情',
        hidden: true
      }
    },
    {
      path: 'supplierEdit',
      // component: () => import('@/views/CRM/supplier/edit'),
      name: 'supplierEdit',
      meta: {
        title: '供应商编辑',
        hidden: true
      }
    },
    // 异常处理  errorHanding
    {
      path: 'errorHanding',
      // component: () => import('@/views/CRM/errorHanding/index'),
      name: 'errorHanding',
      meta: { title: '异常处理' }
    },
    {
      path: 'errorDetail',
      // component: () => import('@/views/CRM/errorHanding/detail'),
      name: 'errorDetail',
      meta: { title: '异常处理详情' }
    }
  ]
}
export default crmRouter
